package ooday05;

public class EnumDemo {
    public static void main(String[] args) {
        Season s1 = Season.WINTER;
        System.out.println(s1);

        Season[] seasons = Season.values();//获取调用枚举的对象
        for (int i = 0; i < seasons.length; i++) {
            System.out.println(seasons[i]);//输出4个枚举对象
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonDesc());
        }

        Season s = Season.valueOf("SPRING");
        System.out.println(s.getSeasonName() + "," + s.getSeasonDesc());
        switch (s) {
            case SPRING:
                System.out.println("天气"+ s.getSeasonDesc()+",去放风筝了");
            case WINTER:
                System.out.println(s.getSeasonName() + "很" + s.getSeasonDesc());
            case AUTUMN:
                System.out.println(s.getSeasonName() + "很" + s.getSeasonDesc());
            case SUMMER:
                System.out.println(s.getSeasonName() + "很" + s.getSeasonDesc());

        }


    }
}
